package com.ruoyi.common.enums;

/**
 * 用户状态
 * 
 * @author ruoyi
 */
public enum SignStatus
{
    ON_TIME(0L, "准时签到"),
    ON_TIME_SIGN_OUT(1L, "准时签退"),
    LATE(2L, "迟到"),
    EARLY_LEAVE(3L, "早退"),
    ATTENDANCE_EXCEPTION(4L, "考勤异常");

    private final Long code;
    private final String info;

    SignStatus(Long code, String info) {
        this.code = code;
        this.info = info;
    }

    public Long getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static SignStatus getStatusByCode(Long code) {
        for (SignStatus status : SignStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
